/*
 * Copyright (c) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http:  // www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef SWANLINK_FINANCE_TECSUN_READERADAPTOR_H
#define SWANLINK_FINANCE_TECSUN_READERADAPTOR_H

#include "iccreader_adaptor.h"
#include <string>
#include <queue>

namespace SwanLink {
namespace Finance {

class Tecsun_Adaptor:public IccReaderAdaptor
{
 public:
    Tecsun_Adaptor();
    virtual ~Tecsun_Adaptor();
    // 公共接口
    virtual int Open(const Transport& tran);
    virtual int Close();
    virtual bool IsOpen();
    virtual int Reset();
    virtual int GetStatus(int module, char *err);

    /**
     * 获取设备信息
     */
    virtual int GetDeviceInfo(DeviceInfo &devInfo);
    /**
     * IO控制
     */
    virtual int IccIOCtrl(IOType type, int value);
    /**
     * cpu命令
     */
    virtual int ApduCommand(IOType type, int len, uint8_t cmd[], uint8_t cmd_out[]);
    /**
     * 寻卡
     */
    virtual int CardSearch(int timeout, SearchResult *result);
    /**
     * 停止寻卡
     */
    virtual int CardStopSearch();
    /**
     * 激活非存储卡
     */
    virtual int RfCardActive(RfCardInfo &cardInfo);
    /**
     * 非存储卡休眠
     */
    virtual int RfCardDormancy();
    /**
     * 扫描数据
     */
    virtual int ScanData(const DeviceConfig& config, ResultData &result);

 private:
    int m_iStatus;
    bool m_isOpen;
    SearchResult *m_pSearch;
};
}  // namespace Finance
}  // namespace SwanLink
#endif  // SWANLINK_FINANCE_TECSUN_READERADAPTOR_H
